//
//  OPHUploadRequest.m
//  AtWork2
//
//  Created by lingen on 16/3/30.
//  Copyright © 2016年 Foreverht. All rights reserved.
//

#import "OPHUploadRequest.h"
#import <AFNetworking/AFNetworking.h>


@interface OPHUploadRequest()

@property (nonatomic,strong) NSURLSession* session;

@property (nonatomic,strong) NSURLSessionUploadTask* uploadTask;

@end

@implementation OPHUploadRequest

/**
 *  根据inputStream和文件名，创建一个下载链接
 *
 *  @param fileName    文件名
 *  @param inputStream 文件流
 *
 *  @return 返回实例
 */
-(instancetype)initWith:(NSString*)url filenName:(NSString*)fileName inputStream:(NSInputStream*)inputStream length:(int64_t)length{

     if (self = [super init]) {
          _url = url;
          _inputStream = inputStream;
          _fileName = fileName;
          _uploadId = [[NSUUID UUID] UUIDString];
          _session = [NSURLSession sharedSession];
          _timeout = 60 * 20;//默认为20分钟超时
          _length = length;

     }
     return self;
}

@end
